package com.example.flowerpcback.controller;

import com.example.flowerpcback.req.DictionaryReq;
import com.example.flowerpcback.req.UserReq;
import com.example.flowerpcback.resp.CommonResp;
import com.example.flowerpcback.resp.DictionaryResp;
import com.example.flowerpcback.resp.PageResp;
import com.example.flowerpcback.resp.UserResp;
import com.example.flowerpcback.services.DictionaryService;
import com.example.flowerpcback.services.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;


@RestController //这是返回接口
@RequestMapping("/dictionary")
public class DictionaryController {

    private static final Logger LOG = LoggerFactory.getLogger(DictionaryController.class);

    @Resource
    private DictionaryService dictionaryService;


    @GetMapping("/all")
    public CommonResp<List<DictionaryResp>> list(@Valid DictionaryReq req){
        CommonResp<List<DictionaryResp>> resp= new CommonResp<>();
        List<DictionaryResp> res = dictionaryService.all(req);
        resp.setData(res);
        return  resp;
    }
}

